<?php


namespace App\Extensions\Grid\Actions;

use Encore\Admin\Grid\Displayers\Actions;

class LayerActions extends Actions
{
    /**
     * Render view action.
     *
     * @return string
     */
    protected function renderView()
    {
        return <<<EOT
<a href="javascript:;" onclick="layer_full('查看','{$this->getResource()}/{$this->getRouteKey()}')"  class="{$this->grid->getGridRowName()}-view">
    查看
</a>
EOT;
    }

    /**
     * Render edit action.
     *
     * @return string
     */
    protected function renderEdit()
    {
        return <<<EOT
<a href="javascript:;" onclick="layer_full('编辑','{$this->getResource()}/{$this->getRouteKey()}/edit')" class="{$this->grid->getGridRowName()}-edit">
    编辑
</a>
EOT;
    }

    protected function renderDelete()
    {
        $this->setupDeleteScript();

        return <<<EOT
<a href="javascript:void(0);" data-id="{$this->getKey()}" class="{$this->grid->getGridRowName()}-delete">
    删除
</a>
EOT;
    }
}
